package com.itheima.demo4_synchronized;

public class DrawThread extends Thread {
    private Account account;
    public DrawThread(String name, Account account) {
        super(name);
        this.account = account;
    }
    @Override
    public void run(){
//        小明、小红同时取钱
        account.draw(account.getMoney());
    }
}
